#include "widget.h"
#include "ui_widget.h"


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
   mybutton=new QPushButton(this);
    mybutton->setText("点击我");
    connect(mybutton,&QPushButton::pressed,this,&Widget::Hander);
}

void Widget::Hander()
{
    if(mybutton->text()==QString("点击我"))
    {
        mybutton->setText("不玩了");
    }else{
        mybutton->setText("点击我");
    }
}

Widget::~Widget()
{
    delete ui;
}

